home *** CD-ROM | disk | FTP | other *** search
/ PC Basics 53 / PC Basics Issue 53.iso / Software / Internet / Invboard.exe / PC Basics 53 / Invboard / upload / upgrade3.php < prev   
Encoding:
PHP Script  |  2002-06-12  |  2.8 KB  |  87 lines

  1. <?php
  2.  
  3. /*
  4. +--------------------------------------------------------------------------
  5. |   IBFORUMS v1 UPGRADE FROM BETA3 TO RC1
  6. |   ========================================
  7. |   by Matthew Mecham and David Baxter
  8. |   (c) 2001,2002 IBForums
  9. |   http://www.ibforums.com
  10. |   ========================================
  11. |   Web: http://www.ibforums.com
  12. |   Email: phpboards@ibforums.com
  13. |   Licence Info: phpib-licence@ibforums.com
  14. +---------------------------------------------------------------------------
  15. |
  16. |   > Wrapper script
  17. |   > Script written by Matt Mecham
  18. |   > Date started: 14th February 2002
  19. |
  20. +--------------------------------------------------------------------------
  21. */
  22.  
  23. //-----------------------------------------------
  24. // USER CONFIGURABLE ELEMENTS
  25. //-----------------------------------------------
  26.  
  27. // Root path
  28.  
  29. $root_path = "./";
  30.  
  31. //-----------------------------------------------
  32. // NO USER EDITABLE SECTIONS BELOW
  33. //-----------------------------------------------
  34.  
  35. error_reporting  (E_ERROR | E_WARNING | E_PARSE);
  36. set_magic_quotes_runtime(0);
  37.  
  38.  
  39.  
  40.  
  41. //--------------------------------
  42. // Import $INFO, now!
  43. //--------------------------------
  44.  
  45. require $root_path."conf_global.php";
  46.  
  47. //--------------------------------
  48. // Load the DB driver and such
  49. //--------------------------------
  50.  
  51. $INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver'];
  52.  
  53. $to_require = $root_path."sources/Drivers/".$INFO['sql_driver'].".php";
  54. require ($to_require);
  55.  
  56. $DB = new db_driver;
  57.  
  58. $DB->obj['sql_database']     = $INFO['sql_database'];
  59. $DB->obj['sql_user']         = $INFO['sql_user'];
  60. $DB->obj['sql_pass']         = $INFO['sql_pass'];
  61. $DB->obj['sql_host']         = $INFO['sql_host'];
  62. $DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
  63.  
  64. // Get a DB connection
  65.  
  66. $DB->connect();
  67.  
  68. $DB->query("ALTER TABLE ibf_members CHANGE time_offset time_offset VARCHAR(10) DEFAULT NULL");
  69. $DB->query("ALTER TABLE ibf_members CHANGE skin skin SMALLINT(5) DEFAULT NULL");
  70. $DB->query("ALTER TABLE ibf_topics CHANGE forum_id forum_id SMALLINT (5) DEFAULT '0' NOT NULL");
  71. $DB->query("ALTER TABLE ibf_members ADD dst_in_use TINYINT (1) DEFAULT '0'");
  72.  
  73. echo("<html><body><b>Running Queries:</b><br>ALTER TABLE ibf_members ADD dst_in_use TINYINT (1) DEFAULT '0'<br>ALTER TABLE ibf_topics CHANGE forum_id forum_id SMALLINT (5) DEFAULT '0' NOT NULL<br>ALTER TABLE ibf_members CHANGE time_offset time_offset VARCHAR(10) DEFAULT NULL<br>ALTER TABLE ibf_members CHANGE skin skin SMALLINT(5) DEFAULT NULL<br><br>Upgrade complete, you may now remove this file</body></html>");
  74.  
  75. exit();
  76.  
  77.  
  78. //+-------------------------------------------------
  79. // GLOBAL ROUTINES
  80. //+-------------------------------------------------
  81.  
  82. function fatal_error($message="", $help="") {
  83.     echo("$message<br><br>$help");
  84.     exit;
  85. }
  86. ?>
  87.